#include "AudioManager.h"
namespace mp_audio
{
	AudioManager::AudioManager()
	{
		m_engine = NULL;
	}

	AudioManager::~AudioManager()
	{
		if(m_engine)
			m_engine->drop();
	}

	void AudioManager::Initialize()
	{
		printf("------------------------------------\n");
		printf("Loading Audio Libraries\n");
		m_engine = createIrrKlangDevice();
		printf("------------------------------------\n");
	}

	void AudioManager::Uninitialize()
	{
		if(m_engine)
		{
			m_engine->drop();
			m_engine = NULL;
		}
	}

	void AudioManager::Update()
	{

	}

	void AudioManager::AudioTest(bool looped)
	{
		if (m_engine){
			m_engine->play2D("Resources/Audio/sail.ogg",true);	
			printf("> Starting Audio Test!\n");
		}
	}

	void AudioManager::InitializeEngine()
	{
		if (!m_engine)
			m_engine = createIrrKlangDevice();
	}
}